﻿using System;
using System.ComponentModel;
using System.Configuration;
using System.Drawing.Design;
using mki.Backup.Objects.Converters;
using mki.Backup.Objects.Editors;

namespace mki.Backup.Objects
{
	public class FTPAddElement : CustomConfigurationElement
	{
		#region Properties (4)

		/// <summary>
		/// Gets or sets the delete after processing.
		/// </summary>
		/// <value>
		/// The delete after processing.
		/// </value>
		[ConfigurationProperty("deleteSourceAfterProcessing", IsRequired = true)]
		public Boolean DeleteSourceAfterProcessing
		{
			get { return Boolean.Parse(this["deleteSourceAfterProcessing"].ToString()); }
			set { this["deleteSourceAfterProcessing"] = value; }
		}

		/// <summary>
		/// Gets or sets the name.
		/// </summary>
		/// <value>
		/// The name.
		/// </value>
		[ConfigurationProperty("name", IsRequired = true, IsKey = true)]
		public new String Name
		{
			get { return base["name"].ToString(); }
			set
			{
				base["name"] = value;
				base.OnPropertyChanged("Name");
			}
		}

		/// <summary>
		/// Gets or sets the file.
		/// </summary>
		/// <value>
		/// The file.
		/// </value>
		[ConfigurationProperty("sourceFileName", IsRequired = true)]
		[Editor(typeof(FolderAndFileBrowserUITypeEditor), typeof(UITypeEditor)), TypeConverter(typeof(ReadOnlyStringConverter))]
		public String SourceFileName
		{
			get { return this["sourceFileName"].ToString(); }
			set { this["sourceFileName"] = value; }
		}

		/// <summary>
		/// Gets or sets the target.
		/// </summary>
		/// <value>
		/// The target.
		/// </value>
		[ConfigurationProperty("targetFileName", IsRequired = true)]
		[Editor(typeof(FileNameUITypeEditor), typeof(UITypeEditor)), TypeConverter(typeof(ReadOnlyStringConverter))]
		public String TargetFileName
		{
			get { return this["targetFileName"].ToString(); }
			set { this["targetFileName"] = value; }
		}

		#endregion Properties
	}
}